import request from '@/utils/request'

// 获取数据源列表
export const getDataSourceList = (params) => {
  return request.get('/dataSource/list', params)
}

// 测试数据源连接
export const testDataSource = (id) => {
  return request.get(`/dataSource/testConnection/${id}`, id)
}
// 添加数据源
export const addDataSource = (data) => {
  return request.post('/dataSource/add', data)
}
// 修改数据源
export const updateDataSource = (data) => {
  return request.put('/dataSource/update', data)
}
// 删除数据源
export const deleteDataSource = (id) => {
  return request.delete(`/dataSource/delete/${id}`, id)
}
// 根据ID获取数据源
export const getDataSourceById = (id) => {
  return request.get(`/dataSource/select/${id}`, id)
}
// 启用数据源
export const enableDataSource = (id) => {
  return request.put(`/dataSource/enable/${id}`, id)
}
// 禁用数据源
export const disableDataSource = (id) => {
  return request.put(`/dataSource/disable/${id}`, id)
}
